package cn.sitemaker.app.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import cn.sitemaker.app.base.BaseFragment;
import cn.sitemaker.app.bean.Trip;
import cn.sitemaker.app.ui.DetailActivity;
import cn.sitemaker.app.util.StringUtils;
import cn.sitemaker.app.widget.AvatarView;
import cn.sitemaker.app.widget.RecordButtonUtil;

/***
 * 行程详情，实际每个item显示的数据类型是Comment
 * 
 * TripDetailFragment.java
 * 
 * @author 火蚁(http://my.oschina.net/u/253900)
 * 
 * @data 2015-1-28 上午11:48:41
 */
public class TripDetailFragment extends BaseFragment {

    private static final String CACHE_KEY_PREFIX = "trip_";
    private AvatarView mIvAvatar;
    private TextView mTvName, mTvFrom, mTvTime, mTvCommentCount;
    private WebView mContent;
    private int mTweetId;
    private Trip mTweet;
    private RelativeLayout mRlRecordSound;
    private final RecordButtonUtil util = new RecordButtonUtil();

    private TextView mLikeUser;
    private TextView mTvLikeState;

    private DetailActivity outAty;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        outAty = (DetailActivity) getActivity();
        return super.onCreateView(inflater, container, savedInstanceState);
    }



    @Override
    public void onStop() {
        super.onStop();
        if (util != null && util.isPlaying()) {
            util.stopPlay();
        }
    }



    @Override
    public void onResume() {
        super.onResume();

    }

    private void fillUI() {
        mIvAvatar.setAvatarUrl(mTweet.getPortrait());
        mTvTime.setText(StringUtils.friendly_time(mTweet.getDate()));
    }

}
